package cn.kkcxy.blog.core.enums;

import lombok.Getter;

/**
 * @BelongsProject: kkcxy-blog
 * @BelongsPackage: cn.kkcxy.blog.core.enums
 * @Author: kkcxy
 * @CreateTime: 2024-09-09 00:47
 * @Description: 通用状态枚举
 * @Version: 1.0
 */
@Getter
public enum StatusEnum {

    ENABLE(0, "启用"),
    DISABLE(1, "禁用");

    public final Integer type;
    public final String message;

    StatusEnum(Integer type, String message) {
        this.type = type;
        this.message = message;
    }

    public static StatusEnum getByType(Integer type) {
        for (StatusEnum statusEnum : StatusEnum.values()) {
            if (statusEnum.getType().equals(type)) {
                return statusEnum;
            }
        }
        return null;
    }
}
